home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-08-16 | 8.6 KB | 367 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWEnvDef.h
- // Release Version: $ ODF 1 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWENVDEF_H
- #define FWENVDEF_H
-
- //========================================================================================
- // Definitions Specific to the Build Configuration
- //========================================================================================
-
- #ifndef FWBLDDEF_H
- #include "FWBldDef.h"
- #endif
-
- //========================================================================================
- // Wrappers for C
- //========================================================================================
-
- #ifdef __cplusplus
-
- // C++ compilation
-
- #define FW_EXTERN_C_BEGIN \
- extern "C" \
- {
- #define FW_EXTERN_C_END \
- }
-
- #else
-
- // Good 'ol C compilation
-
- #define FW_EXTERN_C_BEGIN
- #define FW_EXTERN_C_END
-
- #endif
-
- //========================================================================================
- // Metrowerks -- Macintosh
- //========================================================================================
-
- #ifdef __MWERKS__
-
- #ifndef FW_BUILD_MAC
- #error "FW_BUILD_MAC should have already been defined in FWBldDef.h"
- #endif
- // #define FW_BUILD_MAC
- // #undef FW_BUILD_WIN
- // #undef FW_BUILD_WIN16
- // #undef FW_BUILD_WIN32
- // #undef FW_BUILD_WIN32S
-
- #if 0x0800 <= __MWERKS__
- # if __option(exceptions)
- # define FW_NATIVE_EXCEPTIONS
- # endif
- # if __option(RTTI)
- # define FW_COMPILER_SUPPORTS_RTTI
- # endif
- #endif
-
- #ifdef FW_BUILD_MAC68K
- #ifndef FW_ODFLIB
- #define FW_ODFLIB_IMPORT
- #endif
- #endif
-
- #ifndef FW_ANSI_TEMPLATE_INTANTIATION
- #define FW_ANSI_TEMPLATE_INTANTIATION 1
- #endif
-
- #define ppcinterfaces 1
-
- #ifndef OLDROUTINENAMES
- #define OLDROUTINENAMES 0
- #endif
-
- #ifndef OLDROUTINELOCATIONS
- #define OLDROUTINELOCATIONS 0
- #endif
-
- // Hack to control what is exported from a CFM shared lib on PPC. Define functions
- // with indicative names which CodeWarrior will place in the .exp file. The MPW tool
- // MWExportTool will then filter the .exp removing exports between off functions and
- // on functions, inclusive. The functions are dead-stripped since they are not exported
- // and never referenced.
-
- #define FW_EXPORT_ON(file, id) \
- extern "C" void _FW_export_lib_on_##file##id(); \
- extern "C" void _FW_export_lib_on_##file##id() { }
- #define FW_EXPORT_OFF(file, id) \
- extern "C" void _FW_export_lib_off_##file##id(); \
- extern "C" void _FW_export_lib_off_##file##id() { }
-
- #define FW_FOUR_BYTE_INTS __fourbyteints__
-
- #ifndef FW_BUILD_MAC68K
- // Force PowerPC alignment
- #pragma options align=power
- #endif
-
- //========================================================================================
- // Symantec C++ -- Macintosh
- //========================================================================================
- #elif defined SYMANTEC_CPLUS && !defined _WINDOWS
-
- #pragma options(system_includes_from_project_tree)
-
- #define FW_AGGRESSIVE_PRECOMPILE 1
-
- // #ifndef FW_USE_TEMPLATE_PRAGMAS
- // #define FW_USE_TEMPLATE_PRAGMAS 1
- // #endif
-
- #ifndef FW_ANSI_TEMPLATE_INTANTIATION
- #define FW_ANSI_TEMPLATE_INTANTIATION 1
- #endif
-
- #define PRAGMA_LIB_EXPORT 1
- #define PRAGMA_IMPORT 1
-
- #ifndef SOMLINK
- #define SOMLINK
- #endif
-
- #ifndef SOMDLINK
- #define SOMDLINK
- #endif
-
- #ifndef FW_BUILD_MAC
- #error "FW_BUILD_MAC should have already been defined in FWBldDef.h"
- #endif
- // #define FW_BUILD_MAC
- // #undef FW_BUILD_WIN
- // #undef FW_BUILD_WIN16
- // #undef FW_BUILD_WIN32
- // #undef FW_BUILD_WIN32S
-
- #define ppcinterfaces 1
-
- #ifndef OLDROUTINENAMES
- #define OLDROUTINENAMES 0
- #endif
-
- #ifndef OLDROUTINELOCATIONS
- #define OLDROUTINELOCATIONS 0
- #endif
-
- #define FW_EXPORT_ON
- #define FW_EXPORT_OFF
-
- #ifndef FW_FOUR_BYTE_INTS
- #define FW_FOUR_BYTE_INTS __option(int_4)
- #endif
-
- // Force PowerPC alignment
- #pragma options align=power
-
- //========================================================================================
- // CFM 68K using Symantec SCpp (__SC__ would also catch SPM but that's listed above)
- //========================================================================================
- #elif defined __SC__ && !defined _WINDOWS
-
- #define FW_AGGRESSIVE_PRECOMPILE 1
-
- // #ifndef FW_USE_TEMPLATE_PRAGMAS
- // #define FW_USE_TEMPLATE_PRAGMAS 1
- // #endif
-
- #ifndef FW_ANSI_TEMPLATE_INTANTIATION
- #define FW_ANSI_TEMPLATE_INTANTIATION 1
- #endif
-
- // We want clients of the ODF library to turn on
- // the import pragmas. Define FW_ODFLIB only when building
- // the ODF shared library. - [sfu]
-
- #ifndef FW_ODFLIB
- #define FW_ODFLIB_IMPORT
- #endif
-
- #ifndef SOMLINK
- #define SOMLINK
- #endif
-
- #ifndef SOMDLINK
- #define SOMDLINK
- #endif
-
- #ifndef FW_BUILD_MAC
- #error "FW_BUILD_MAC should have already been defined in FWBldDef.h"
- #endif
- // #define FW_BUILD_MAC
- // #undef FW_BUILD_WIN
- // #undef FW_BUILD_WIN16
- // #undef FW_BUILD_WIN32
- // #undef FW_BUILD_WIN32S
-
- #define ppcinterfaces 1
-
- #ifndef OLDROUTINENAMES
- #define OLDROUTINENAMES 0
- #endif
-
- #ifndef OLDROUTINELOCATIONS
- #define OLDROUTINELOCATIONS 0
- #endif
-
- #define FW_EXPORT_ON
- #define FW_EXPORT_OFF
-
- #ifndef FW_FOUR_BYTE_INTS
- #define FW_FOUR_BYTE_INTS __option(int_4)
- #endif
-
- //========================================================================================
- // Mr. C -- Macintosh
- //========================================================================================
- #elif defined __MRC__
-
- #ifndef FW_USE_TEMPLATE_PRAGMAS
- #define FW_USE_TEMPLATE_PRAGMAS 1
- #endif
-
- // We want clients of the ODF library to turn on
- // the import pragmas. Define FW_ODFLIB only when building
- // the ODF shared library. - [sfu]
-
- #ifndef FW_ODFLIB
- #define FW_ODFLIB_IMPORT
- #endif
-
- #ifndef FW_BUILD_MAC
- #error "FW_BUILD_MAC should have already been defined in FWBldDef.h"
- #endif
- // #define FW_BUILD_MAC
- // #undef FW_BUILD_WIN
- // #undef FW_BUILD_WIN16
- // #undef FW_BUILD_WIN32
- // #undef FW_BUILD_WIN32S
-
- #define ppcinterfaces 1
-
- #ifndef OLDROUTINENAMES
- #define OLDROUTINENAMES 0
- #endif
-
- #ifndef OLDROUTINELOCATIONS
- #define OLDROUTINELOCATIONS 0
- #endif
-
- #define FW_EXPORT_ON
- #define FW_EXPORT_OFF
-
- #define FW_FOUR_BYTE_INTS 1
-
- // Force PowerPC alignment
- #pragma options align=power
-
- //========================================================================================
- // Microsoft Visual C++ - Windows
- //========================================================================================
- #elif defined _MSC_VER
-
- #ifdef _WINDOWS_
- #error Include FWEnvDef.h before including Windows.h
- #endif
-
- #define FW_BUILD_WIN
- #define FW_BUILD_WIN32
- #define FW_HAS_INSTANCE_DATA
- #define FW_NATIVE_EXCEPTIONS
-
- #define FW_FOUR_BYTE_INTS 1
- #define FW_USE_PRECOMPILED_HEADERS 1
-
- #ifdef _DEBUG
- #define FW_DEBUG
- #endif
-
- #define PLATFORM_WINDOWS 1
-
- #define STRICT
- #define WIN32_LEAN_AND_MEAN
- #define WIN32_EXTRA_LEAN
- #include <windows.h>
-
- #pragma warning(disable:4080) // Invalid name in segment pragma
- #pragma warning(disable:4660) // Template specialization already instantiated
-
- //========================================================================================
- // Symantec C++ - Windows
- //========================================================================================
- #elif defined __SC__ && defined _WINDOWS
-
- #ifdef _WINDOWS_
- #error Include FWEnvDef.h before including Windows.h
- #endif
-
- #define FW_BUILD_WIN
- #define FW_BUILD_WIN32
- #define FW_HAS_INSTANCE_DATA
- #define FW_NATIVE_EXCEPTIONS
-
- #define FW_FOUR_BYTE_INTS 1
- #define FW_AGGRESIVE_PRECOMPILE 1
-
- #ifdef _DEBUG
- #define FW_DEBUG
- #endif
-
- #define PLATFORM_WINDOWS 1
-
- #define STRICT
- #include <windows.h>
-
- #define SOMLINK __stdcall
- #define SOMDLINK __stdcall
-
- //========================================================================================
- // Unsupported Compiler
- //========================================================================================
- #else
-
- #error Unsupported compiler
-
- #endif
-
- //========================================================================================
- // Other Defines
- //========================================================================================
-
- #ifdef FW_BUILD_MAC
- #ifndef _PLATFORM_MACINTOSH_
- #define _PLATFORM_MACINTOSH_ 1
- #endif
- #ifndef PLATFORM_MACINTOSH
- #define PLATFORM_MACINTOSH 1
- #endif
- #if !defined(FW_HAS_INSTANCE_DATA)
- #define FW_HAS_INSTANCE_DATA
- #endif
-
- #ifdef FW_NATIVE_EXCEPTIONS
- # define _NATIVE_EXCEPTIONS_
- #endif
-
- #define FW_EXPORT
- #endif
-
- #ifdef FW_BUILD_WIN
- #ifndef PLATFORM_WINDOWS
- #define PLATFORM_WINDOWS 1
- #endif
-
- #define FW_EXPORT __declspec(dllexport)
-
- #endif
-
- #endif
-